{extend name="public/base"/}
{block name="content"}
<section class="content-header">
    <h1>
        内容发布
        <small>publish content</small>
    </h1>


    <ol class="breadcrumb">
        <li><a href="{:U('Index/index')}"><i class="fa fa-dashboard"></i> 首页</a></li>
        <li class="active">发布内容</li>
    </ol>


</section>
<form action="{:U('Content/addContent', ['term_id'=>$termInfo['id']])}" method="post">
    <input type="hidden" name="term_id" value="{:$termInfo['id']}">
    <input type="hidden" name="model_id" value="{:$termInfo['model_id']}">
    <input type="hidden" name="cover_img" id="imgs" value="">
    <input type="hidden" name="status" value="0">
    <input type="hidden" name="rec_ok" value="0">
    <input type="hidden" name="top_ok" value="0">
    <section class="content">
        <div class="row">
            <div class="col-md-12">
                <div class="" style="margin-top:20px;">
                    <div class="box-body pad" style="padding-bottom:0;">
                        <div class="highlight">
                            <dl>
                                <dt class="adt">
                                <em class="required">*</em>文章标题
                                </dt>
                                <dd class="ftype_input">
                                <div class="fbox">
                                    <input type="text" name="title" value="" class="form-control">

                                </div>
                                </dd>
                            </dl>
                        </div>
                        <div class="highlight">
                            <dl>
                                <dt class="adt">
                                <em class="required"></em>关键词
                                </dt>
                                <dd class="ftype_input">
                                <div class="fbox">
                                    <input type="text" name="keywords" class="form-control">

                                </div>
                                </dd>
                            </dl>
                        </div>
                        <div class="highlight">
                            <dl>
                                <dt class="adt">
                                <em class="required"></em>描述
                                </dt>
                                <dd class="ftype_input">
                                <div class="fbox">
                                    <textarea class="form-control" id="des" rows="4" name="description" placeholder="摘要描述" 
                                        style="width: 100%;height:100px;font-size: 14px; line-height: 18px;padding: 10px;" ></textarea>

                                </div>
                                </dd>
                            </dl>
                        </div>

                    </div>

                    <!-- editor -->
                    <div class="box-body pad">
                        <textarea id="editor" class="textarea" name="content" placeholder=""
                            style="width: 100%;height:300px;font-size: 14px; line-height: 18px;padding: 10px;"></textarea>
                    <script> $(function(){ UE.getEditor("editor"); });</script>
                    </div>
                    <!-- editor end -->

                    <div class="box-body pad" style="">
                        <div class="highlight" style="padding-bottom:5px;">
                            <span style="zoom:1;overflow: hidden;">				       	 
                                <input type="checkbox" class="dese"  value="1" name="intercept" style="float:left;margin-top: 7px;"> <span style="float:left;">是否截取内容</span> 
                            </span>
                            <span>
                                <input type="text" size="3"  value="150"  class="fontsize">字符至内容摘要 
                            </span>			    	

                        </div>	
                    </div>
                    <!-- 于此相关的class id 等勿动 -->
                    <script>
$(document).ready(function(){
        $(".dese").click(function(){

            if($('.dese').is(':checked')) {
            var TEST = UE.getEditor('editor').getContentTxt();
            var SIZE = $(".fontsize").val();
            $("#des").val(TEST.substr(0,SIZE));
            }else{
            $("#des").val('');
            }

            });

        });
                    </script>
                    <!-- 勿动 -->

                    <!-- 推荐 显示 置顶-->
                    <div class="box-body pad" style="padding-top:0;padding-bottom:0;">
                        <div class="highlight">
                            <dl>
                                <dt class="adt">
                                <em class="required"></em>发布时间：
                                </dt>
                                <dd class="ftype_input">
                                <div class="fbox">
                                    <input class="form-control" name="create_time" value="{:date("Y-m-d H:i:s",time())}" placeholder="发表时间">

                                </div>
                                </dd>
                            </dl>
                        </div>
                        <div class="highlight">
                            <dl>
                                <dt class="adt">
                                <em class="required"></em>状态：
                                </dt>
                                <dd class="ftype_input">
                                <div class="fbox">
                                    <label class="flabel">
                                        <input type="checkbox" name="status" checked="checked"  value="1" style="width:10px;float:left;">
                                        <span style="float:left;margin-left:8px;">前台显示</span>					    			    	
                                    </label>
                                    <label class="flabel">
                                        <input type="checkbox" name="rec_ok"  value="1" style="width:10px;float:left;">
                                        <span style="float:left;margin-left:8px;">推荐</span>					    			    	
                                    </label>
                                    <label class="flabel">
                                        <input type="checkbox" name="top_ok"  value="1" style="width:10px;float:left;">
                                        <span style="float:left;margin-left:8px;">置顶</span>					    			    	
                                    </label>

                                </div>
                                </dd>
                            </dl>
                        </div>

                        <div class="highlight">
                            <dl>
                                <dt class="adt">
                                <em class="required"></em>封面图片
                                </dt>
                                <dd class="ftype_input">
                                <div class="fbox">
                                    <div id="uploader" class="wu-example-one" name="cover_img">
                                        <!--用来存放文件信息-->
                                        <div id="thelist2" class="uploader-list"></div>
                                        <div class="btns">
                                            <div class="picker" id="picker2">图片上传</div>
                                        </div>
                                    </div>

                                </div>
                                </dd>
                            </dl>
                        </div>

                        <div class="box">
                        {foreach $formList as $name => $form}
                            <div class="box-body pad" style="padding:10px 20px;">
                                {$name}：
                                            {$form}
                            </div>
                        {/foreach}
                        </div>

                        <!-- SEO -->
                        <div class="box-header with-border" style="margin:0 18px;padding-left:0;">
                            <h3 class="box-title" >SEO设置:</h3>
                        </div>
                        <div class="highlight">
                            <dl>
                                <dt class="adt">
                                <em class="required"></em>标题:</dt>
                                <dd class="ftype_input">
                                <div class="fbox">
                                    <input class="form-control" name="seo_title" placeholder="META Title（标题）">

                                </div>
                                </dd>
                            </dl>
                        </div>

                        <div class="highlight">
                            <dl>
                                <dt class="adt">
                                <em class="required"></em>关键词:</dt>
                                <dd class="ftype_input">
                                <div class="fbox">
                                    <input class="form-control" name="seo_keywords" placeholder="META Keywords（关键词）">
                                </div>
                                </dd>
                            </dl>
                        </div>

                        <div class="highlight">
                            <dl>
                                <dt class="adt">
                                <em class="required"></em>摘要:</dt>
                                <dd class="ftype_input">
                                <div class="fbox">
                                    <textarea class="form-control" rows="14" name="seo_description" style="width:100%;height:130px;" placeholder="摘要描述"></textarea>
                                </div>
                                </dd>
                            </dl>
                        </div>
                        <!-- SEO END-->
                        <div style="padding:10px 20px;"><input type="submit" class="btn btn-block btn-primary" style="width:100px; border:none;" value="提交"/></div>
                        <div style="clear:both">
                        </div>



                    </div>
                </div>

            </div>

        </section>


        <div style="clear:both">
        </div>
    </form>

    {/block}
